package cn.zhiyong.pr.config;

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JPanel;

import cn.zhiyong.pr.main.MainController;
import cn.zhiyong.pr.main.MainData;
import cn.zhiyong.pr.main.MyConstant;

public class ConfigPanel extends JPanel {
//	private JButton config_JB;
	private ConfigPanel_controller controller;
	private ConfigPanel_bean bean;
	private MainData data;
	private MainController mainController;
	private JButton database_BT;

	public ConfigPanel(MainData data, MainController mainController) {
		this.data=data;
		this.mainController=mainController;
		bean=new ConfigPanel_bean();
		controller=new ConfigPanel_controller(this);
//		setBorder(BorderFactory.createEtchedBorder());
		createComponent();
		layoutComponent();
		addListener();
		setName("configPanel");
	}
	
	private void addListener() {
//		config_JB.addActionListener(controller);
		database_BT.addActionListener(controller);
	}

	/**
	 * done
	 */
	private void createComponent() {
//		config_JB=new JButton(MyConstant.configPanel_config);
		database_BT=new JButton(MyConstant.CONFIG_DATABASE);
	}

	/**
	 * done
	 */
	private void layoutComponent() {
		setLayout(new FlowLayout(FlowLayout.LEFT));
//		add(config_JB);
		add(database_BT);
	}
	
	public ConfigPanel_controller getController() {
		return controller;
	}

	public ConfigPanel_bean getbean() {
		return bean;
	}

	public MainController getMainController() {
		return mainController;
	}

	public MainData getMainData() {
		return data;
	}

}
